package com.ruoyi.system.fallbackFactory.impl;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.db.domain.system.dto.AccountDetailsDTO;
import com.ruoyi.system.fallbackFactory.RemoteSystemAppService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author SampertZh
 * @description System-App服务降级处理
 * @date 2022/7/4
 */
@Component
public class RemoteSystemAppFallbackFactory implements FallbackFactory<RemoteSystemAppService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteSystemAppFallbackFactory.class);
    @Override
    public RemoteSystemAppService create(Throwable throwable)
    {
        log.error("app服务调用失败:{}", throwable.getMessage());
        return new RemoteSystemAppService()
        {
            @Override
            public AjaxResult insertAccountDetails(AccountDetailsDTO accountDetailsDTO, String source) {
                return null;
            }

            @Override
            public AjaxResult groupInitCacheInit(String source) {
                return null;
            }
        };

    }
}
